<!DOCTYPE html>
<html lang="en">

<head>
    <#include "/pages/admin_include/head.html"/>
</head>

<body data-type="widgets">
<script src="pages/admin/assets/js/theme.js"></script>
<div class="am-g tpl-g">
    <!-- 头部 -->
    <#include "/pages/admin_include/header.html"/>
    <!-- 风格切换 -->
    <#include "/pages/admin_include/theme.html"/>
    <!-- 侧边导航栏 -->
    <#include "/pages/admin_include/menu.html"/>

    <!-- 内容区域 -->
    <div class="tpl-content-wrapper">
        <div class="row-content am-cf">

            <div class="row">

                <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
                    <div class="widget am-cf">
                        <div class="widget-head am-cf">
                            <div class="widget-title am-fl">新增文章</div>
                            <div class="widget-function am-fr">
                                <a href="javascript:;" class="am-icon-cog"></a>
                            </div>
                        </div>
                        <div class="widget-body am-fr">
                            <form class="am-form tpl-form-border-form tpl-form-border-br" method="post" action="admin/article/save">
                                <div class="am-form-group">
                                    <label for="title" class="am-u-sm-3 am-form-label">标题
                                        <span class="tpl-form-line-small-title">Title</span>
                                    </label>
                                    <div class="am-u-sm-9">
                                        <input type="hidden" name="id" value="${(article.id)!}">
                                        <input type="text" class="tpl-form-input" id="title" name="title" value="${(article.title)!}" placeholder="标题" required>
                                        <small>请填写标题，不能为空。</small>
                                    </div>
                                </div>
                                <div class="am-form-group">
                                    <label for="subtitle" class="am-u-sm-3 am-form-label">副标题
                                        <span class="tpl-form-line-small-title">Subtitle</span>
                                    </label>
                                    <div class="am-u-sm-9">
                                        <input type="hidden" name="id" value="${(article.id)!}">
                                        <input type="text" class="tpl-form-input" id="subtitle" name="subtitle" value="${(article.subtitle)!}" placeholder="副标题" required>
                                        <small>请填写副标题，不能为空。</small>
                                    </div>
                                </div>
                                <div class="am-form-group">
                                    <label for="columnId" class="am-u-sm-3 am-form-label">所属栏目 <span class="tpl-form-line-small-title">Column</span></label>
                                    <div class="am-u-sm-9">
                                        <select id="columnId" name="columnId" data-am-selected="{searchBox: 1}" style="display: none;">
                                            <option value="0">无</option>
                                            <#list columns as c>
                                                <#if article?? && ((c.id)==(article.columnId))>
                                                    <option value="${c.id}" selected>${c.name!}</option>
                                                <#else>
                                                    <option value="${c.id}">${c.name!}</option>
                                                </#if>
                                            </#list>
                                        </select>
                                    </div>
                                </div>

                                <div class="am-form-group">
                                    <label class="am-u-sm-3 am-form-label">序号
                                        <span class="tpl-form-line-small-title">No.</span></label>
                                    <div class="am-u-sm-9">
                                        <input type="text" name="orderNo" value="${(article.orderNo)!}"  placeholder="请填写序号">
                                    </div>
                                </div>
                                <div class="am-form-group">
                                    <label for="article-intro" class="am-u-sm-3 am-form-label">摘要
                                        <span class="tpl-form-line-small-title">Summary</span></label>
                                    <div class="am-u-sm-9">
                                        <textarea class="" rows="10" id="article-intro" name="summary" placeholder="请输入摘要内容">${(article.summary)!}</textarea>
                                    </div>
                                </div>
                                <div class="am-form-group">
                                    <div class="am-u-sm-9 am-u-sm-push-3">
                                        <button type="submit" class="am-btn am-btn-primary tpl-btn-bg-color-success ">
                                            提交
                                        </button>
                                        <a type="button" class="am-btn am-btn-primary tpl-btn-bg-color-success " href="admin/article?pageNumber=${pageNumber!}&pageSize=${pageSize!}">
                                            返回
                                        </a>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>

        </div>
    </div>
</div>
<!-- footer_js -->
<#include "/pages/admin_include/footer_js.html"/>

</body>

</html>